//
// Phong vertex shader
//

varying	vec3 l;
varying	vec3 v;
varying	vec3 n;
varying float texture;

uniform	vec3	lightPos;
uniform	vec3	eyePos;

void main(void)
{
    vec3 p = vec3      ( gl_ModelViewMatrix * gl_Vertex );      // transformed point to world space

    l = normalize (  lightPos  - p );                    // vector to light source
    v = normalize (  eyePos    - p );                    // vector to the eye
    n = normalize ( gl_NormalMatrix * gl_Normal );              // transformed n

	gl_TexCoord[0] = gl_MultiTexCoord0;
	texture = gl_FogCoord;
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}